﻿using System;
using System.Windows.Forms;
using DCIMAP.GANS.Basic;
using DCIMAP.GANS.GeneticAlgorithms;
using DCIMAP.GANS.GeneticAlgorithms.Kit;

using DCIMAP.GANS.GeneticAlgorithms.Legacy;



public class Program
{
    public static void Main()
    {
        int Len = 1000;
        int[] weights = new int[Len];
        Random random = new Random();
        for(int i = 0; i < Len; i++)
            weights[i] = random.Next(1, 10000);

        GeneticAlgorithm algorithm = new GeneticAlgorithm();

        MinimalGeneratorFamily generator = new MinimalGeneratorFamily(10);
        generator.Generator = new StringArrayGenerator(Len);
        algorithm.GeneratorFamily = generator;

        algorithm.BufferEvaluator = new SyncronousBufferEvaluator();
        algorithm.BufferEvaluator.GeneEvaluator = new IQEvaluator(weights);

        algorithm.MutantFamily = new MutantFamily();
        algorithm.MutantFamily.MutantCount = new ConstantCountProvider(1);
        IQMutator mutator = new IQMutator();
        mutator.MutationsCount = new ConstantCountProvider(1);
        algorithm.MutantFamily.Mutator = mutator;

        algorithm.Procurer = new RouletteProcurer(1);
        algorithm.CrossFamily = new CrossFamily();
        algorithm.CrossFamily.ChildCount = new ConstantCountProvider(1);
        algorithm.CrossFamily.Crosser = new IQCrosser();

        algorithm.Cleaner = new ThresholdCleaner(100);

        GeneticAlgorithmDriver driver = new GeneticAlgorithmDriver();
        driver.StartInfo.SystemInfo.System = algorithm;
        driver.StartInfo.SystemInfo.EnableAutosaving = false;
        driver.StartInfo.EnableLog = false;
        driver.StartInfo.InputParameters = false;
        driver.OutputPanel = new IQOutputPanel(weights);

        driver.RunAsApplication();

    }
}

